{% extends 'admin/base.html' %}

{% block main %}

<div class="layui-fluid">

  <div class="layui-row layui-col-space30">
    {{ category_form.csrf_token }}
    <div class="layui-col-lg12">
      <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>分类目录</legend>
      </fieldset>
    </div>
  </div>

  <div class="layui-row layui-col-space30">
    <div class="layui-col-lg6">
      <div class="layui-row">
        <div class="layui-col-lg12">
          <blockquote class="layui-elem-quote">分类管理</blockquote>
        </div>
        <div class="layui-col-lg-12">
          <form class="layui-form layui-form-pane" action="/admin/categories" method="post">
            <!-- <div class="layui-form-item">
              <label class="layui-form-label">父分类</label>
              <div class="layui-input-block">
                {{ category_form.parentid(class="layui-input",placeholder="请输入文章标题") }}
              </div>
            </div> -->
            <div class="layui-form-item">
              <label class="layui-form-label">分类名称</label>
              <div class="layui-input-block">
                {{ category_form.name(class="layui-input",placeholder="请输入分类名称") }}
              </div>
            </div>
            <div class="layui-form-item">
              <label class="layui-form-label">分类别名</label>
              <div class="layui-input-block">
                {{ category_form.slug(class="layui-input",placeholder="请输入分类别名") }}
              </div>
            </div>
            <div class="layui-form-item">
              <label class="layui-form-label">分类描述</label>
              <div class="layui-input-block">
                {{ category_form.description(class="layui-input",placeholder="请输入分类描述") }}
              </div>
            </div>
            <div class="layui-form-item">
              <div class="layui-input-block">
                <button type="submit" class="layui-btn" lay-submit="create">立即创建</button>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
    <div class="layui-col-lg6">
      <div class="layui-row">
        <div class="layui-col-lg12">
          <blockquote class="layui-elem-quote">分类列表</blockquote>
        </div>
        <div class="layui-col-lg12">
          <table class="layui-hide" id="categories-table" lay-filter="test"></table>
        </div>
      </div>
    </div>
  </div>


  {% endblock %}
  {% block script %}
  {{ super() }}

  <script src="{{url_for('static',filename='/js/category.js')}}" charset="utf-8"></script>
  {% endblock %}